#region Summary

// 
// Owner : JackieHan 
// 
// Solution : DailyCollection 
// 
// Project : Jackie.Utility
// 
// File : JackieEnvironment.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 自定义的获取环境的信息
// 
// History : 
//			2011-04-26 17:36:42	    Create 
// 

#endregion

#region Using

using System;
using System.Management;

#endregion

namespace Jackie.Utility
{
    /// <summary> 
    /// 自定义的获取环境的信息
    /// </summary>
    public class JackieEnvironment
    {
        ///<summary>
        /// 获取机器的Mac地址
        ///</summary>
        public static string MacAddress
        {
            get
            {
                var mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
                var moc = mc.GetInstances();
                string macStr = string.Empty;
                foreach (var mo in moc)
                {
                    if ((bool)mo["IPEnabled"])
                        macStr = mo["MacAddress"].ToString();
                }
                return macStr;
            }
        }
    }
}